package com.byl.modules.core.controller;


import com.byl.common.modules.controller.BaseController;
import com.byl.modules.core.service.CustomerService;
import com.byl.sdk.bean.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/customer")
public class CustomerController  extends BaseController {

    @Autowired
    CustomerService customerService;

    @PostMapping("/query")
    public String query(@RequestBody Map map) {
        ResultBean bean=customerService.query(map);
        return success("查询成功",bean);
    }


    @GetMapping("/delete")
    public String delete(String id){
        int rs=customerService.delete(id);
        return rs==1?success("删除成功"):fail("删除失败");
    }
}
